Introduce convenience method for get commands
              
              #1476
            
            Replies: 3 comments 22 replies
-
| 
         Interesting observation @waldekmastykarz I think that this would be good default behaviour of a command rather than introducing a specific switch to invoke such behaviour. In the example you gave for   | 
  
Beta Was this translation helpful? Give feedback.
-
| 
         Yes definitely makes sense to me, can't really recall any cli implementations doing things like that, so find it hard to compare for 'best practices'. But 👍 from me.  | 
  
Beta Was this translation helpful? Give feedback.
-
| 
         Agree this could be a nice feature to have, but just a thought though, when there are a large number of "things" to select from,  Could there be some simple pre-filtering of the list of "things",  
  | 
  
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Currently, when using
getcommands, you need to specify which item you want to retrieve, either by its URL, ID, name, etc. In some cases you know the identifier upfront, but often you need to run the correspondinglistcommand first to get the identifier and then run thegetcommand with the right ID.What if we could simplify this experience by introducing a convenience mode for
getcommands that would combine thelistandgetfunctionality in a single command? For example, imagine you'd runspo site get --interactive. Since there is no URL specified, thespo site getcommand will first retrieve all sites usingspo site list. Then, it will provide you with a prompt to select the site that you'd like to get. After selecting a site from the list, the CLI would execute thespo site getcommand with the selected site.The convenience switch could be triggered either explicitly through a separate option like
--interactive, or implicitly, when no identifier has been specified in agetcommand.What do you think @pnp/office-365-cli-maintainers?
Beta Was this translation helpful? Give feedback.
All reactions