@@ -40,15 +40,17 @@ func init() {
4040 // Add optional filters for list
4141 appListCmd .Flags ().String ("name" , "" , "Filter by application name" )
4242 appListCmd .Flags ().String ("version" , "" , "Filter by version label" )
43+ appListCmd .Flags ().Int ("limit" , 20 , "Max apps to return (default 20)" )
4344
4445 // Limit rows returned for app history (0 = all)
45- appHistoryCmd .Flags ().Int ("limit" , 100 , "Max deployments to return (default 100 )" )
46+ appHistoryCmd .Flags ().Int ("limit" , 20 , "Max deployments to return (default 20 )" )
4647}
4748
4849func runAppList (cmd * cobra.Command , args []string ) error {
4950 client := getKernelClient (cmd )
5051 appName , _ := cmd .Flags ().GetString ("name" )
5152 version , _ := cmd .Flags ().GetString ("version" )
53+ lim , _ := cmd .Flags ().GetInt ("limit" )
5254
5355 pterm .Debug .Println ("Fetching deployed applications..." )
5456
@@ -76,6 +78,7 @@ func runAppList(cmd *cobra.Command, args []string) error {
7678 {"App Name" , "Version" , "App Version ID" , "Region" , "Actions" , "Env Vars" },
7779 }
7880
81+ rows := 0
7982 for _ , app := range * apps {
8083 // Format env vars
8184 envVarsStr := "-"
@@ -98,6 +101,10 @@ func runAppList(cmd *cobra.Command, args []string) error {
98101 actionsStr ,
99102 envVarsStr ,
100103 })
104+ rows ++
105+ if lim > 0 && rows >= lim {
106+ break
107+ }
101108 }
102109
103110 PrintTableNoPad (tableData , true )
0 commit comments