forked from dirk-thomas/vcstool
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f28e605
commit d652957
Showing
5 changed files
with
61 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
#!/usr/bin/env python | ||
|
||
import sys | ||
from vcstool.commands.help import main | ||
from vcstool.commands.vcs import main | ||
|
||
sys.exit(main() or 0) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#!/usr/bin/env python | ||
|
||
import sys | ||
from vcstool.commands.help import main | ||
|
||
sys.exit(main() or 0) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
from __future__ import print_function | ||
|
||
import sys | ||
|
||
from vcstool.commands.help import get_entrypoint, get_parser | ||
from vcstool.commands.help import main as help_main | ||
|
||
|
||
def main(args=None): | ||
# no help to extract command first (which might be followed by --help) | ||
parser = get_parser(add_help=False) | ||
ns, _ = parser.parse_known_args(args) | ||
args = args if args is not None else sys.argv[1:] | ||
|
||
# relay to specific command | ||
if ns.command and ns.command != 'help': | ||
entrypoint = get_entrypoint(ns.command) | ||
if not entrypoint: | ||
return 1 | ||
|
||
args.remove(ns.command) | ||
return entrypoint(args) | ||
|
||
# remove help command if specified | ||
if ns.command: | ||
args.remove(ns.command) | ||
|
||
return help_main(args) | ||
|
||
|
||
if __name__ == '__main__': | ||
sys.exit(main()) |