Remove NewApp initializer

and move defaulting to `App.Setup`
This commit is contained in:
Dan Buch
2016-06-22 12:47:57 -04:00
parent b5f16ff767
commit df685fbacc
9 changed files with 808 additions and 761 deletions

View File

@@ -292,6 +292,11 @@ def _context_parent(source):
return re.sub('\\.Parent\\(\\)', '.Lineage()[1]', source, flags=re.UNICODE)
@_migrator
def _app_init(source):
return re.sub('cli\\.NewApp\\(\\)', '(&cli.App{})', source, flags=re.UNICODE)
def test_migrators():
import difflib
@@ -432,6 +437,13 @@ _MIGRATOR_TESTS = (
\t\t\t\tName: "tootles", Aliases: []string{"toots", "t"},
\t\t\t},
\t\t}
"""),
("""
\t\tapp := cli.NewApp()
\t\tapp.HideHelp = true
""", """
\t\tapp := (&cli.App{})
\t\tapp.HideHelp = true
""")
)