clan/create: rename path to name argument

This commit is contained in:
Johannes Kirschbauer
2025-07-12 15:03:37 +02:00
parent c4f67ca44d
commit ed2663ac7b

View File

@@ -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,