clan/create: rename path to name argument
This commit is contained in:
@@ -27,10 +27,10 @@ def register_create_parser(parser: argparse.ArgumentParser) -> None:
|
||||
)
|
||||
|
||||
parser.add_argument(
|
||||
"path",
|
||||
type=Path,
|
||||
"name",
|
||||
type=str,
|
||||
nargs="?",
|
||||
help="Path where to write the clan template to",
|
||||
help="Name of the clan to create. If not provided, will prompt for a name.",
|
||||
)
|
||||
|
||||
parser.add_argument(
|
||||
@@ -42,17 +42,17 @@ def register_create_parser(parser: argparse.ArgumentParser) -> None:
|
||||
|
||||
def create_flake_command(args: argparse.Namespace) -> None:
|
||||
# Ask for a path interactively if none provided
|
||||
if args.path is None:
|
||||
if args.name is None:
|
||||
user_input = input("Enter a name for the new clan: ").strip()
|
||||
if not user_input:
|
||||
msg = "Error: name is required."
|
||||
raise ClanError(msg)
|
||||
|
||||
args.path = Path(user_input)
|
||||
args.name = Path(user_input)
|
||||
|
||||
create_clan(
|
||||
CreateOptions(
|
||||
dest=args.path,
|
||||
dest=Path(args.name),
|
||||
template=args.template,
|
||||
setup_git=not args.no_git,
|
||||
src_flake=args.flake,
|
||||
|
||||
Reference in New Issue
Block a user