diff --git a/lib/spack/spack/ci.py b/lib/spack/spack/ci.py
index ed06524073d75064ef4988d819ee591b7df3cd12..cbdfccb8bfcc324386692e3a60b296feb60fde6a 100644
--- a/lib/spack/spack/ci.py
+++ b/lib/spack/spack/ci.py
@@ -947,8 +947,9 @@ def read_cdashid_from_mirror(spec, mirror_url):
 def push_mirror_contents(env, spec, yaml_path, mirror_url, build_id):
     if mirror_url:
         tty.debug('Creating buildcache')
-        buildcache._createtarball(env, yaml_path, None, mirror_url, None,
-                                  True, True, False, False, True, False)
+        buildcache._createtarball(env, yaml_path, None, True, False,
+                                  mirror_url, None, True, False, False, True,
+                                  False)
         if build_id:
             tty.debug('Writing cdashid ({0}) to remote mirror: {1}'.format(
                 build_id, mirror_url))
diff --git a/lib/spack/spack/cmd/buildcache.py b/lib/spack/spack/cmd/buildcache.py
index f837e6b8a3a96fb4c006f1fca1a0d2ebd3d26d28..6fd4a2c5b7e8e33a161662a49c1c982403d07a81 100644
--- a/lib/spack/spack/cmd/buildcache.py
+++ b/lib/spack/spack/cmd/buildcache.py
@@ -60,8 +60,14 @@ def setup_parser(subparser):
                                             "building package(s)")
     create.add_argument('-y', '--spec-yaml', default=None,
                         help='Create buildcache entry for spec from yaml file')
-    create.add_argument('--no-deps', action='store_true', default='false',
-                        help='Create buildcache entry wo/ dependencies')
+    create.add_argument('--only', default='package,dependencies',
+                        dest='things_to_install',
+                        choices=['package', 'dependencies'],
+                        help=('Select the buildcache mode. the default is to'
+                              ' build a cache for the package along with all'
+                              ' its dependencies. Alternatively, one can'
+                              ' decide to build a cache for only the package'
+                              ' or only the dependencies'))
     arguments.add_common_arguments(create, ['specs'])
     create.set_defaults(func=createtarball)
 
@@ -304,8 +310,8 @@ def match_downloaded_specs(pkgs, allow_multiple_matches=False, force=False,
     return specs_from_cli
 
 
-def _createtarball(env, spec_yaml, packages, directory, key, no_deps, force,
-                   rel, unsigned, allow_root, no_rebuild_index):
+def _createtarball(env, spec_yaml, packages, add_spec, add_deps, directory,
+                   key, force, rel, unsigned, allow_root, no_rebuild_index):
     if spec_yaml:
         packages = set()
         with open(spec_yaml, 'r') as fd:
@@ -347,14 +353,23 @@ def _createtarball(env, spec_yaml, packages, directory, key, no_deps, force,
             tty.debug('skipping external or virtual spec %s' %
                       match.format())
         else:
-            tty.debug('adding matching spec %s' % match.format())
-            specs.add(match)
-            if no_deps is True:
+            if add_spec:
+                tty.debug('adding matching spec %s' % match.format())
+                specs.add(match)
+            else:
+                tty.debug('skipping matching spec %s' % match.format())
+
+            if not add_deps:
                 continue
+
             tty.debug('recursing dependencies')
             for d, node in match.traverse(order='post',
                                           depth=True,
                                           deptype=('link', 'run')):
+                # skip root, since it's handled above
+                if d == 0:
+                    continue
+
                 if node.external or node.virtual:
                     tty.debug('skipping external or virtual dependency %s' %
                               node.format())
@@ -377,9 +392,12 @@ def createtarball(args):
     # restrict matching to current environment if one is active
     env = ev.get_env(args, 'buildcache create')
 
-    _createtarball(env, args.spec_yaml, args.specs, args.directory,
-                   args.key, args.no_deps, args.force, args.rel, args.unsigned,
-                   args.allow_root, args.no_rebuild_index)
+    add_spec = ('package' in args.things_to_install)
+    add_deps = ('dependencies' in args.things_to_install)
+
+    _createtarball(env, args.spec_yaml, args.specs, add_spec, add_deps,
+                   args.directory, args.key, args.force, args.rel,
+                   args.unsigned, args.allow_root, args.no_rebuild_index)
 
 
 def installtarball(args):
diff --git a/share/spack/spack-completion.bash b/share/spack/spack-completion.bash
index 4082b7ff416bf12f82c8af8e41996cf58ed3e2d1..d2e4a28682878f9e070b67bafea0fc9159e6d563 100755
--- a/share/spack/spack-completion.bash
+++ b/share/spack/spack-completion.bash
@@ -382,7 +382,7 @@ _spack_buildcache() {
 _spack_buildcache_create() {
     if $list_options
     then
-        SPACK_COMPREPLY="-h --help -r --rel -f --force -u --unsigned -a --allow-root -k --key -d --directory --no-rebuild-index -y --spec-yaml --no-deps"
+        SPACK_COMPREPLY="-h --help -r --rel -f --force -u --unsigned -a --allow-root -k --key -d --directory --no-rebuild-index -y --spec-yaml --only"
     else
         _all_packages
     fi