3 from __future__ import print_function
5 from browser_stack import get_stack, save_stack
8 if command.startswith('--'):
13 if command in ('get', 'peek', 'print'):
14 if stack: print(stack[0], end='')
16 elif command in ('list', 'list-all'):
17 if stack: print(''.join(stack), end='')
20 browser = os.path.basename(sys.argv[2]) + '\n'
22 # With 'push' this prevents duplicates
26 stack.insert(0, browser)
27 elif command == 'pop':
28 pass # The browser was already removed
30 raise ValueError('Unknown command "%s"' % command)