Improve --help output, set defaults for input files
This commit is contained in:
@@ -13,27 +13,35 @@ from typing import Any
|
||||
def main():
|
||||
parser = argparse.ArgumentParser(
|
||||
description="Convert a passwd/group/shadow file to a directory of systemd JSON user records.",
|
||||
formatter_class=argparse.ArgumentDefaultsHelpFormatter,
|
||||
)
|
||||
parser.add_argument(
|
||||
"passwd_file",
|
||||
"-p",
|
||||
"--passwd_file",
|
||||
type=Path,
|
||||
help="Path to the passwd file.",
|
||||
metavar="PASSWD_FILE",
|
||||
metavar="PATH",
|
||||
default="/etc/passwd",
|
||||
)
|
||||
parser.add_argument(
|
||||
"group_file",
|
||||
"-g",
|
||||
"--group_file",
|
||||
type=Path,
|
||||
help="Path to the group file.",
|
||||
metavar="GROUP_FILE",
|
||||
metavar="PATH",
|
||||
default="/etc/group",
|
||||
)
|
||||
parser.add_argument(
|
||||
"shadow_file",
|
||||
"-s",
|
||||
"--shadow_file",
|
||||
type=Path,
|
||||
help="Path to the shadow file.",
|
||||
metavar="SHADOW_FILE",
|
||||
metavar="PATH",
|
||||
default="/etc/shadow",
|
||||
)
|
||||
|
||||
parser.add_argument(
|
||||
"-o",
|
||||
"--output_dir",
|
||||
type=Path,
|
||||
help="Path to a directory to store json user records.",
|
||||
@@ -42,22 +50,28 @@ def main():
|
||||
)
|
||||
|
||||
parser.add_argument(
|
||||
"-e",
|
||||
"--email-domain",
|
||||
type=str,
|
||||
help="Email domain to construct email addresses for users (i.e. <username>@DOMAIN).",
|
||||
required=False,
|
||||
metavar="DOMAIN",
|
||||
)
|
||||
|
||||
parser.add_argument(
|
||||
"-iu",
|
||||
"--ignore-user-file",
|
||||
type=Path,
|
||||
help="A file containing usernames to ignore (one username per line).",
|
||||
required=False,
|
||||
metavar="IGNORE_USER_FILE",
|
||||
metavar="PATH",
|
||||
)
|
||||
|
||||
parser.add_argument(
|
||||
"-ig",
|
||||
"--ignore-group-file",
|
||||
type=Path,
|
||||
help="A file containing group names to ignore (one group name per line).",
|
||||
required=False,
|
||||
metavar="IGNORE_GROUP_FILE",
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user