visit icon indicating copy to clipboard operation
visit copied to clipboard

VisIt doesn't handle the case where scripts have arguments named the same as VisIt arguments

Open JustinPrivitera opened this issue 8 months ago • 5 comments

Taken from a conversation with a user:

#!/usr/bin/env python3
import argparse
import visit # type: ignore

def cli_args() -> argparse.Namespace:
    parser = argparse.ArgumentParser()
    parser.add_argument('-nn', type=int)
    #parser.add_argument('-nodes', type=int)
    return parser.parse_args(visit.Argv())

def main():
    print(cli_args())

main()
exit()

so if you do visit -nowin -cli -s test.py -nn 1 you'll get an error but if you comment out the -nn and uncomment the -nodes in cli_args and then run visit -nowin -cli -s test.py -nodes 1 then it works

What are our thoughts on this? Should we support this case? At the very least it's a pitfall users can run into.

JustinPrivitera avatar Jun 20 '24 22:06 JustinPrivitera