Skip to content

Commit

Permalink
added useless alias for yapm command in order to map to yap
Browse files Browse the repository at this point in the history
  • Loading branch information
alemazzo committed Jul 26, 2021
1 parent 153a6e4 commit 7a7119d
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
4 changes: 4 additions & 0 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@

if __name__ == '__main__':
args = parser.parse_arguments()

if not args.packages:
parser.print_help()
exit()

command = get_command(args.command)
packages = args.packages
Expand Down
5 changes: 3 additions & 2 deletions snapcraft.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,6 @@ parts:
source: .

apps:
yapm:
command: main.py
yap:
command: main.py
aliases: [yap]
7 changes: 7 additions & 0 deletions yap/arguments/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,16 @@ def _get_real_parser(self):

def parse(self):
return self._get_real_parser().parse_args()

def print_help(self):
self._get_real_parser().print_help()


def parse_arguments():
parser = Parser()
args = parser.parse()
return args

def print_help():
parser = Parser()
parser.print_help()

0 comments on commit 7a7119d

Please sign in to comment.