input_group = parser.add_argument_group(description="Input")
input_group.add_argument("input_string", nargs='*',
help='Text to slugify')
input_group.add_argument("--stdin", action='store_true',
help="Take the text from STDIN")
parser.add_argument("--no-entities", action='store_false', dest='entities', default=True,
help="Do not convert HTML entities to unicode")
parser.add_argument("--no-decimal", action='store_false', dest='decimal', default=True,
help="Do not convert HTML decimal to unicode")
parser.add_argument("--no-hexadecimal", action='store_false', dest='hexadecimal', default=True,
help="Do not convert HTML hexadecimal to unicode")
parser.add_argument("--max-length", type=int, default=0,
help="Output string length, 0 for no limit")
parser.add_argument("--word-boundary", action='store_true', default=False,
help="Truncate to complete word even if length ends up shorter than --max_length")
parser.add_argument("--save-order", action='store_true', default=False,
help="When set and --max_length > 0 return whole words in the initial order")
parser.add_argument("--separator", type=str, default=DEFAULT_SEPARATOR,
help="Separator between words. By default " + DEFAULT_SEPARATOR)
parser.add_argument("--stopwords", nargs='+',
help="Words to discount")
parser.add_argument("--regex-pattern",
help="Python regex pattern for disallowed characters")
parser.add_argument("--no-lowercase", action='store_false', dest='lowercase', default=True,
help="Activate case sensitivity")
parser.add_argument("--replacements", nargs='+',
help="""Additional replacement rules e.g. "|->or", "%%->percent".""")
parser.add_argument("--allow-unicode", action='store_true', default=False,
help="Allow unicode characters")
args = parser.parse_args(argv[1:])
if args.input_string and args.stdin:
parser.error("Input strings and --stdin cannot work together")
if args.replacements: def split_check(repl):
SEP = '->' if SEP notin repl:
parser.error("Replacements must be of the form: ORIGINAL{SEP}REPLACED".format(SEP=SEP)) return repl.split(SEP, 1)
args.replacements = [split_check(repl) for repl in args.replacements]
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung ist noch experimentell.