Commit 382ba8d 1 parent 17ae140 commit 382ba8d Copy full SHA for 382ba8d
File tree 2 files changed +6
-1
lines changed
packages/@angular/cli/commands
tests/e2e/tests/commands/get
2 files changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ export interface GetOptions {
11
11
12
12
const GetCommand = Command . extend ( {
13
13
name : 'get' ,
14
- description : 'Get a value from the configuration.' ,
14
+ description : 'Get a value from the configuration. Example: ng get [key] ' ,
15
15
works : 'everywhere' ,
16
16
17
17
availableOptions : [
@@ -32,6 +32,10 @@ const GetCommand = Command.extend({
32
32
+ 'you need the --global argument.' ) ;
33
33
}
34
34
35
+ if ( ! rawArgs [ 0 ] ) {
36
+ throw new SilentError ( 'No key specified. Run "ng help get" for usage.' ) ;
37
+ }
38
+
35
39
const value = config . get ( rawArgs [ 0 ] ) ;
36
40
37
41
if ( value === null || value === undefined ) {
Original file line number Diff line number Diff line change @@ -4,6 +4,7 @@ import {expectToFail} from '../../../utils/utils';
4
4
export default function ( ) {
5
5
return Promise . resolve ( )
6
6
. then ( ( ) => expectToFail ( ( ) => ng ( 'get' , 'apps.zzz.prefix' ) ) )
7
+ . then ( ( ) => expectToFail ( ( ) => ng ( 'get' ) ) )
7
8
. then ( ( ) => ng ( 'get' , 'apps.0.prefix' ) )
8
9
. then ( ( { stdout } ) => {
9
10
if ( ! stdout . match ( / a p p / ) ) {
You can’t perform that action at this time.
0 commit comments