Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit ff140ae

Browse filesBrowse files
JelleZijlstralarryhastings
authored andcommitted
blurb: small usability improvements (#161)
* blurb: small usability improvements * only suggest 'blurb help' for invalid commands; filter --help from help output * support other commands starting with "-" (none currently exist)
1 parent 79faca9 commit ff140ae
Copy full SHA for ff140ae

File tree

1 file changed

+6
-1
lines changed
Filter options

1 file changed

+6
-1
lines changed

‎blurb/blurb.py

Copy file name to clipboardExpand all lines: blurb/blurb.py
+6-1Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -744,7 +744,7 @@ def subcommand(fn):
744744
def get_subcommand(subcommand):
745745
fn = subcommands.get(subcommand)
746746
if not fn:
747-
error("Unknown subcommand: {}".format(subcommand))
747+
error("Unknown subcommand: {}\nRun 'blurb help' for help.".format(subcommand))
748748
return fn
749749

750750

@@ -771,6 +771,8 @@ def help(subcommand=None):
771771
summaries = []
772772
longest_name_len = -1
773773
for name, fn in subcommands.items():
774+
if name.startswith('-'):
775+
continue
774776
longest_name_len = max(longest_name_len, len(name))
775777
if not fn.__doc__:
776778
error("help is broken, no docstring for " + fn.__name__)
@@ -821,6 +823,9 @@ def help(subcommand=None):
821823
print(doc)
822824
sys.exit(0)
823825

826+
# Make "blurb --help" work.
827+
subcommands["--help"] = help
828+
824829

825830
@subcommand
826831
def test(*args):

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.