Skip to content
This repository was archived by the owner on Dec 5, 2022. It is now read-only.

Commit 47df724

Browse files
committed
Merge pull request #4 from tanmaykm/procarg
allow command line argument for proc file system
2 parents dfad946 + 516d3bc commit 47df724

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

nsenter/__init__.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,9 @@ def main(): # pragma: no cover
111111
parser.add_argument('--target', '-t', required=True, metavar='PID',
112112
help='A target process to get contexts from')
113113

114+
parser.add_argument('--proc', '-p', metavar='PROCFS', default='/proc',
115+
help='The target proc file system')
116+
114117
group = parser.add_argument_group('Namespaces')
115118

116119
for ns in NAMESPACE_NAMES:
@@ -137,7 +140,7 @@ def main(): # pragma: no cover
137140
namespaces = []
138141
for ns in NAMESPACE_NAMES:
139142
if getattr(args, ns) or args.all:
140-
namespaces.append(Namespace(args.target, ns))
143+
namespaces.append(Namespace(args.target, ns, proc=args.proc))
141144

142145
for ns in namespaces:
143146
stack.enter_context(ns)

0 commit comments

Comments
 (0)