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 Oct 25, 2023
1 parent b99bb9a commit 576e527
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 @@ -38,7 +38,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 @@ -36,7 +36,6 @@ def main():
parser.add_argument('--nocache', action='store_true')
parser.add_argument('--nocleanup', action='store_true', help='do not remove the docker container when stopped')
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 @@ -50,6 +49,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 @@ -89,3 +89,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 576e527

Please sign in to comment.