OLD | NEW |
---|---|
(Empty) | |
1 #!/usr/bin/env python2 | |
2 # | |
3 # Copyright 2017 The Chromium Authors. All rights reserved. | |
4 # Use of this source code is governed by a BSD-style license that can be | |
5 # found in the LICENSE file. | |
6 ''' | |
watk
2017/03/02 23:13:49
newline before
| |
7 This is a wrapper script to start your editor. You also need to add this script | |
8 to your path. | |
9 ''' | |
10 | |
11 import argparse | |
12 import os | |
13 import sh | |
14 | |
15 CHROMIUM_ROOT = os.environ['HOME'] + "/workspace/chromium/src" | |
16 | |
17 os.chdir(CHROMIUM_ROOT) | |
18 | |
19 ###### Dont change this part. BEGIN ##### | |
20 parser = argparse.ArgumentParser() | |
21 parser.add_argument("-f", "--filepath", help="Filepath.") | |
22 parser.add_argument("-l", "--line", type=int, help="Line number.") | |
23 parser.add_argument("-m", "--multifilepath", help="Multi Filepath.") | |
24 args = parser.parse_args() | |
25 ###### Dont change this part. END ##### | |
26 | |
27 # Here I start a vscode instance | |
watk
2017/03/02 23:13:49
delete "Here I".
| |
28 sh.code(".") | |
29 | |
30 # Open one file with line number | |
31 if args.filepath != None: | |
32 sh.code("-g", args.filepath + ":" + str(args.line)) | |
33 # Open multi files | |
34 else: | |
35 sh.code(args.multifilepath.split(",")) | |
OLD | NEW |