Skip to content

Commit

Permalink
make podman a separate command rodman
Browse files Browse the repository at this point in the history
  • Loading branch information
tfoote committed Nov 14, 2024
1 parent c3f57f5 commit 8b354ec
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
3 changes: 2 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@
'package_data': {'rocker': ['templates/*.em']},
'entry_points': {
'console_scripts': [
'rocker = rocker.cli:main',
'rocker = rocker.cli:rocker_main',
'rodman = rocker.cli:rodman_main',
'detect_docker_image_os = rocker.cli:detect_image_os',
],
'rocker.extensions': [
Expand Down
11 changes: 9 additions & 2 deletions src/rocker/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
from .os_detector import detect_os


def main():
def main(implementation='rocker'):

parser = argparse.ArgumentParser(
description='A tool for running docker with extra options',
Expand All @@ -37,7 +37,6 @@ def main():
parser.add_argument('--nocleanup', action='store_true', help='do not remove the docker container when stopped')
parser.add_argument('--persist-image', action='store_true', help='do not remove the docker image when stopped', default=False) #TODO(tfoote) Add a name to it if persisting
parser.add_argument('--pull', action='store_true')
parser.add_argument('--use-podman', action='store_true')
parser.add_argument('--version', action='version',
version='%(prog)s ' + get_rocker_version())

Expand All @@ -51,6 +50,7 @@ def main():

args = parser.parse_args()
args_dict = vars(args)
args_dict['use_podman'] = implementation == 'podman'

if args.noexecute:
from .core import OPERATIONS_DRY_RUN
Expand Down Expand Up @@ -95,3 +95,10 @@ def detect_image_os():
return 0
else:
return 1

def rocker_main():
return main(implementation='rocker')


def rodman_main():
return main(implementation='podman')

0 comments on commit 8b354ec

Please sign in to comment.