Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add formats to help for command line #1056

Closed
wants to merge 4 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 9 additions & 8 deletions bin/vyper
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,13 @@ from vyper.parser.parser import parse_to_lll
from vyper.parser import parser_utils
from vyper import compile_lll


warnings.simplefilter('always')
sys.tracebacklimit = 0
tb_limit = os.environ.get('VYPER_TRACEBACK_LIMIT')
if tb_limit:
sys.tracebacklimit = int(tb_limit)

parser = argparse.ArgumentParser(description='Vyper programming language for Ethereum')
parser.add_argument('--version', action='version', version='{0}'.format(vyper.__version__))
parser.add_argument('input_file', help='Vyper sourcecode to compile')
parser.add_argument('-f', help='Format to print', default='bytecode', dest='format')
parser.add_argument('--show-gas-estimates', help='Show gas estimates in ir output mode.', action="store_true")

args = parser.parse_args()


def uniq(seq):
exists = set()
Expand Down Expand Up @@ -90,6 +83,14 @@ if __name__ == '__main__':
output_format['source_map'] = get_source_map
output_format['source_map_asm_list'] = get_source_map_asm_list

parser = argparse.ArgumentParser(description='Vyper programming language for Ethereum')
parser.add_argument('--version', action='version', version='{0}'.format(vyper.__version__))
parser.add_argument('input_file', help='Vyper sourcecode to compile')
parser.add_argument('-f', help='Format to print. Options: {}'.format(', '.join(output_format.keys())), default='bytecode', dest='format')
parser.add_argument('--show-gas-estimates', help='Show gas estimates in ir output mode.', action="store_true")

args = parser.parse_args()

with open(args.input_file) as fh:
code = fh.read()

Expand Down