Skip to content

Commit

Permalink
Add version info
Browse files Browse the repository at this point in the history
  • Loading branch information
alexesprit committed Mar 23, 2020
1 parent e49800d commit fc7bacc
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions alias.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@

from argparse import ArgumentParser, RawTextHelpFormatter

prog = 'alias'
version = '1.0.0'

ALIASES_DIR_MACRO = '%USERPROFILE%\\Documents\\Scripts\\Aliases'
ALIASES_DIR_VAR = 'ALIASES_DIR'

Expand All @@ -13,7 +16,7 @@
ALIAS_WILDCARD = '*.cmd'
ALIAS_EXTENSION = '.cmd'

SETUP_PROMPT = 'alias is not installed. Do you want to install it (y/N)? '
SETUP_PROMPT = f'{prog} is not installed. Do you want to install it (y/N)? '
DESCRIPTION = '''Manage your aliases.
Add alias:
Expand Down Expand Up @@ -181,14 +184,16 @@ def parse_alias(string):


def create_arg_parser():
arg_parser = ArgumentParser(prog='alias', description=DESCRIPTION,
arg_parser = ArgumentParser(prog=prog, description=DESCRIPTION,
formatter_class=RawTextHelpFormatter)
arg_parser.add_argument('-d', '--delete', metavar='ALIAS',
help='Delete the alias')
arg_parser.add_argument('-s', '--search', metavar='TEXT',
help='Search for the text in alias commands')
arg_parser.add_argument('-v', '--verbose', action='store_true',
help='Verbosed output')
arg_parser.add_argument('--version', action='version',
version=f'{prog} v{version}')
return arg_parser


Expand Down

0 comments on commit fc7bacc

Please sign in to comment.