{"action":"created","issue":{"url":"https://api.github.com/repos/codegangsta/cli/issues/219","labels_url":"https://api.github.com/repos/codegangsta/cli/issues/219/labels{/name}","comments_url":"https://api.github.com/repos/codegangsta/cli/issues/219/comments","events_url":"https://api.github.com/repos/codegangsta/cli/issues/219/events","html_url":"https://github.com/codegangsta/cli/issues/219","id":73433349,"number":219,"title":"Global string flag with default value is not available to commands","user":{"login":"torrick","id":61832,"avatar_url":"https://avatars.githubusercontent.com/u/61832?v=3","gravatar_id":"","url":"https://api.github.com/users/torrick","html_url":"https://github.com/torrick","followers_url":"https://api.github.com/users/torrick/followers","following_url":"https://api.github.com/users/torrick/following{/other_user}","gists_url":"https://api.github.com/users/torrick/gists{/gist_id}","starred_url":"https://api.github.com/users/torrick/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/torrick/subscriptions","organizations_url":"https://api.github.com/users/torrick/orgs","repos_url":"https://api.github.com/users/torrick/repos","events_url":"https://api.github.com/users/torrick/events{/privacy}","received_events_url":"https://api.github.com/users/torrick/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-05-05T21:14:38Z","updated_at":"2015-05-06T03:12:06Z","closed_at":"2015-05-05T21:24:14Z","body":"If I have this: \r\n\r\n```go\r\napp := cli.NewApp()\r\napp.Flags = []cli.Flag{cli.StringFlag{Name: \"myFlag\", Value: \"somevalue\"}\r\napp.Commands = []cli.Command{ \r\n  { \r\n    Name: \"my_command\", \r\n    Action: func(c *cli.Context) { fmt.Println(c.String(\"myFlag\"))}\r\n  },\r\n```\r\n\r\nI'd expect `my_command` to output `somevalue`.  However it just outputs an empty string.  When I make the flag local it works as expected.\r\n\r\n```go\r\napp := cli.NewApp()\r\napp.Flags = []cli.Flag{cli.StringFlag{Name: \"myFlag\", Value: \"somevalue\"}\r\napp.Commands = []cli.Command{ \r\n  { \r\n    Name: \"my_command\", \r\n    Action: func(c *cli.Context) { fmt.Println(c.String(\"myFlag\"))},\r\n    Flags: []cli.Flag{cli.StringFlag{Name: \"myFlag\", Value: \"somevalue\"}}\r\n  },\r\n```\r\nThis works as I'd expect where `my_command` outputs \"somevalue\""},"comment":{"url":"https://api.github.com/repos/codegangsta/cli/issues/comments/99303836","html_url":"https://github.com/codegangsta/cli/issues/219#issuecomment-99303836","issue_url":"https://api.github.com/repos/codegangsta/cli/issues/219","id":99303836,"user":{"login":"jszwedko","id":316880,"avatar_url":"https://avatars.githubusercontent.com/u/316880?v=3","gravatar_id":"","url":"https://api.github.com/users/jszwedko","html_url":"https://github.com/jszwedko","followers_url":"https://api.github.com/users/jszwedko/followers","following_url":"https://api.github.com/users/jszwedko/following{/other_user}","gists_url":"https://api.github.com/users/jszwedko/gists{/gist_id}","starred_url":"https://api.github.com/users/jszwedko/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jszwedko/subscriptions","organizations_url":"https://api.github.com/users/jszwedko/orgs","repos_url":"https://api.github.com/users/jszwedko/repos","events_url":"https://api.github.com/users/jszwedko/events{/privacy}","received_events_url":"https://api.github.com/users/jszwedko/received_events","type":"User","site_admin":false},"created_at":"2015-05-06T03:12:06Z","updated_at":"2015-05-06T03:12:06Z","body":"No worries, this has come up before. I actually believe eliminating the `GlobalX` methods are desirable (just having them available via the normal flag access methods), but given that it is an API breaking change, I've put it off for now."}}