Is it possible for argparse to recognize arbitrary number flags such as -3 or -42

Some commands can take flag arguments in the form of -<number> such as -2 or -3 followed by other positional arguments such as file names.

For example:

git log -42 my_branch
tail -10 file1.txt file2.txt

Typically -42 is a shothand for something like -n 42.

argparse documentation mention that numbered flag such as -2 can be differentiated from positional arguments if they are added as such. That works with certain commands such as comm which can only take the arguments -1, -2 and -3.

Though, to get a tail equivalent, this would imply having to add all possible numbers {-1, -2, -3, -4, ...} individually for them to be recognized as flag.

parser = argparse.ArgumentParser(prog="tail")
parser.add_argument("file", nargs="*")  # positional
parser.add_argument("-1", action="store_true")
parser.add_argument("-2", action="store_true")
parser.add_argument("-3", action="store_true")
parser.add_argument("-4", action="store_true")
# ...

Is it possible for argparse to accept flags that are arbitrary numbers?