Skip to content
This repository was archived by the owner on Nov 6, 2025. It is now read-only.

Commit 8e7e4fe

Browse files
Merge pull request #51 from bakfile/add-default-cmd-alias
Add alias to default command, just in case
2 parents 6029078 + 56ea265 commit 8e7e4fe

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

bak/__main__.py

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ def on_call(*args, **kwargs):
3434
return on_decorator
3535

3636

37-
BASIC_HELP_TEXT = "bak FILENAME (creates a bakfile)\n\n" +\
37+
BASIC_HELP_TEXT = "bak FILENAME (creates a bakfile)\n\nalias: bak create\n\n" +\
3838
"See also: bak COMMAND --help"
3939

4040

@@ -47,8 +47,18 @@ def bak():
4747
@normalize_path()
4848
@click.option("--version", required=False, is_flag=True)
4949
@click.argument("filename", required=False, type=click.Path(exists=True))
50-
# Ensures that 'bak --help' is printed if it doesn't get a filename
50+
def _create(filename, version):
51+
create_bak_cmd(filename, version)
52+
53+
@bak.command("create", hidden=True)
54+
@normalize_path()
55+
@click.option("--version", required=False, is_flag=True)
56+
@click.argument("filename", required=False, type=click.Path(exists=True))
5157
def create(filename, version):
58+
create_bak_cmd(filename, version)
59+
60+
# Ensures that 'bak --help' is printed if it doesn't get a filename
61+
def create_bak_cmd(filename, version):
5262
if version:
5363
click.echo(f"bak version {bak_version}")
5464
elif not filename:

0 commit comments

Comments
 (0)