Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- args = cmd.split()
- arguments = []
- i = 0
- while i <= len(args):
- if args[i].startswith('-'):
- if args[i] == '-f' and args[i+1].isdigit():
- arguments.append(args.pop(i))
- arguments.append(args.pop(i))
- else:
- arguments.append(args.pop(i))
- i = i + 1
- return arguments
Add Comment
Please, Sign In to add comment