OLD | NEW |
(Empty) | |
| 1 #!/usr/bin/env python |
| 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 |
| 7 """ |
| 8 This is a wrapper script to start your editor. You also need to add this script |
| 9 to your path. |
| 10 """ |
| 11 |
| 12 import argparse |
| 13 import os |
| 14 import sh |
| 15 |
| 16 CHROMIUM_ROOT = os.environ['HOME'] + "/workspace/chromium/src" |
| 17 |
| 18 os.chdir(CHROMIUM_ROOT) |
| 19 |
| 20 ###### Dont change this part. BEGIN ##### |
| 21 parser = argparse.ArgumentParser() |
| 22 parser.add_argument("-f", "--filepath", help="Filepath.") |
| 23 parser.add_argument("-l", "--line", type=int, help="Line number.") |
| 24 parser.add_argument("-m", "--multifilepath", help="Multi Filepath.") |
| 25 args = parser.parse_args() |
| 26 ###### Dont change this part. END ##### |
| 27 |
| 28 # Start a vscode instance. |
| 29 sh.code(".") |
| 30 |
| 31 # Open one file with line number. |
| 32 if args.filepath != None: |
| 33 sh.code("-g", args.filepath + ":" + str(args.line)) |
| 34 # Open multiple files. |
| 35 else: |
| 36 sh.code(args.multifilepath.split(",,")) |
OLD | NEW |