Skip to content

Commit

Permalink
added a --no-persistent option to capsul runner
Browse files Browse the repository at this point in the history
  • Loading branch information
denisri committed Oct 3, 2023
1 parent e036b2b commit 6ceb239
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion capsul/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,22 @@ def executable_parser(executable):
configure_parser = subparsers.add_parser('configure', help='Configure capsul environment')

run_parser = subparsers.add_parser('run', help='Execute a Capsul process or pipeline')
run_parser.add_argument(
'--non-persistent', dest='non_persistent', action='store_true',
help='use a non-persistent config: database and server will be disposed at'
' the end of the execution, accessing logs will not be possible '
'afterwards')
run_parser.add_argument('executable')

help_parser = subparsers.add_parser('help', help='Get help about a command or a process')
help_parser.add_argument('command_or_executable')

options, args = parser.parse_known_args()

capsul = Capsul()
db_path = None
if options.subcommand == 'run' and options.non_persistent:
db_path = ''
capsul = Capsul(database_path=db_path)

if options.subcommand == 'configure':
# Other commands must be able to work without PyQt installed
Expand Down

0 comments on commit 6ceb239

Please sign in to comment.