@@ -30,12 +30,14 @@ class List extends Command
3030 apm list --themes
3131 apm list --packages
3232 apm list --installed
33+ apm list --installed --enabled
3334 apm list --installed --bare > my-packages.txt
3435 apm list --json
3536
3637 List all the installed packages and also the packages bundled with Atom.
3738 """
3839 options .alias (' b' , ' bare' ).boolean (' bare' ).describe (' bare' , ' Print packages one per line with no formatting' )
40+ options .alias (' e' , ' enabled' ).boolean (' enabled' ).describe (' enabled' , ' Print only enabled packages' )
3941 options .alias (' d' , ' dev' ).boolean (' dev' ).default (' dev' , true ).describe (' dev' , ' Include dev packages' )
4042 options .alias (' h' , ' help' ).describe (' help' , ' Print this usage message' )
4143 options .alias (' i' , ' installed' ).boolean (' installed' ).describe (' installed' , ' Only list installed packages/themes' )
@@ -81,11 +83,14 @@ class List extends Command
8183 manifest ?= {}
8284 manifest .name = child
8385 if options .argv .themes
84- packages .push (manifest) if manifest .theme
86+ if manifest .theme and not (options .argv .enabled and @ isPackageDisabled (manifest .name ))
87+ packages .push (manifest)
8588 else if options .argv .packages
86- packages .push (manifest) unless manifest .theme
89+ unless manifest .theme or (options .argv .enabled and @ isPackageDisabled (manifest .name ))
90+ packages .push (manifest)
8791 else
88- packages .push (manifest)
92+ unless options .argv .enabled and @ isPackageDisabled (manifest .name )
93+ packages .push (manifest)
8994
9095 packages
9196
@@ -114,18 +119,20 @@ class List extends Command
114119 callback? (null , gitPackages)
115120
116121 listBundledPackages : (options , callback ) ->
117- config .getResourcePath (resourcePath) - >
122+ config .getResourcePath (resourcePath) = >
118123 try
119124 metadataPath = path .join (resourcePath, ' package.json' )
120125 {_atomPackages } = JSON .parse (fs .readFileSync (metadataPath))
121126 _atomPackages ?= {}
122127 packages = (metadata for packageName, {metadata} of _atomPackages)
123128
124- packages = packages .filter (metadata) - >
129+ packages = packages .filter (metadata) = >
125130 if options .argv .themes
126131 metadata .theme
127132 else if options .argv .packages
128133 not metadata .theme
134+ else if options .argv .enabled
135+ not @ isPackageDisabled (metadata .name )
129136 else
130137 true
131138
0 commit comments