Commits

Johannes Köster committed dd5eb7a

Only output bash completion code. Else it won't be registered in current
shell.

Comments (0)

Files changed (1)

snakemake/__init__.py

 # -*- coding: utf-8 -*-
 
 import os
+import subprocess
 import glob
 import argparse
 from argparse import ArgumentError
     parser.add_argument(
         "--debug", action="store_true", help="Print debugging output.")
     parser.add_argument(
-        "--bash-completion", action="store_true", help="Register bash completion for snakemake.")
+            "--bash-completion", action="store_true", help="Output code to register bash completion for snakemake. Put the following in your .bashrc (including the accents): `snakemake --bash-completion`")
     parser.add_argument(
         "--version", "-v", action="version", version=__version__)
     return parser
     args = parser.parse_args()
     
     if args.bash_completion:
-        os.system("complete -C snakemake-bash-completion snakemake")
+        print("complete -C snakemake-bash-completion snakemake")
         sys.exit(0)
 
     snakemakepath = get_snakemake_path()