File tree Expand file tree Collapse file tree 2 files changed +6
-1
lines changed
packages/@angular/cli/commands
tests/e2e/tests/commands/get Expand file tree Collapse file tree 2 files changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ export interface GetOptions {
1111
1212const GetCommand = Command . extend ( {
1313 name : 'get' ,
14- description : 'Get a value from the configuration.' ,
14+ description : 'Get a value from the configuration. Example: ng get [key] ' ,
1515 works : 'everywhere' ,
1616
1717 availableOptions : [
@@ -32,6 +32,10 @@ const GetCommand = Command.extend({
3232 + 'you need the --global argument.' ) ;
3333 }
3434
35+ if ( ! rawArgs [ 0 ] ) {
36+ throw new SilentError ( 'No key specified. Run "ng help get" for usage.' ) ;
37+ }
38+
3539 const value = config . get ( rawArgs [ 0 ] ) ;
3640
3741 if ( value === null || value === undefined ) {
Original file line number Diff line number Diff line change @@ -4,6 +4,7 @@ import {expectToFail} from '../../../utils/utils';
44export default function ( ) {
55 return Promise . resolve ( )
66 . then ( ( ) => expectToFail ( ( ) => ng ( 'get' , 'apps.zzz.prefix' ) ) )
7+ . then ( ( ) => expectToFail ( ( ) => ng ( 'get' ) ) )
78 . then ( ( ) => ng ( 'get' , 'apps.0.prefix' ) )
89 . then ( ( { stdout } ) => {
910 if ( ! stdout . match ( / a p p / ) ) {
You can’t perform that action at this time.
0 commit comments