mirror of https://github.com/m-labs/artiq.git
artiq_flash: add --dry-run option.
This commit is contained in:
parent
323c7e66cf
commit
bcc39a8c9d
|
@ -41,6 +41,9 @@ Prerequisites:
|
||||||
|
|
||||||
verbosity_args(parser)
|
verbosity_args(parser)
|
||||||
|
|
||||||
|
parser.add_argument("-n", "--dry-run",
|
||||||
|
default=False, action="store_true",
|
||||||
|
help="Only show the openocd script that would be run")
|
||||||
parser.add_argument("-H", "--host", metavar="HOSTNAME",
|
parser.add_argument("-H", "--host", metavar="HOSTNAME",
|
||||||
type=str, default=None,
|
type=str, default=None,
|
||||||
help="SSH host where the development board is located")
|
help="SSH host where the development board is located")
|
||||||
|
@ -123,6 +126,9 @@ class Programmer:
|
||||||
def start(self):
|
def start(self):
|
||||||
raise NotImplementedError
|
raise NotImplementedError
|
||||||
|
|
||||||
|
def script(self):
|
||||||
|
return "\n".join(self.prog)
|
||||||
|
|
||||||
def do(self):
|
def do(self):
|
||||||
self._command("exit")
|
self._command("exit")
|
||||||
|
|
||||||
|
@ -338,6 +344,9 @@ def main():
|
||||||
else:
|
else:
|
||||||
raise ValueError("invalid action", action)
|
raise ValueError("invalid action", action)
|
||||||
|
|
||||||
|
if args.dry_run:
|
||||||
|
print(programmer.script())
|
||||||
|
else:
|
||||||
try:
|
try:
|
||||||
programmer.do()
|
programmer.do()
|
||||||
finally:
|
finally:
|
||||||
|
|
Loading…
Reference in New Issue