title: Can I alias a subcommand? (shortening the output of `docker ps`)
body: <p>The <code>docker</code> command has a <code>ps</code> sub-command that emits very long lines:</p>
  
  <pre><code>$ docker ps -a
  CONTAINER ID        IMAGE                             COMMAND                  CREATED             STATUS                      PORTS                                                                                                                                                                                                                                                                                                        NAMES
  6e8ec8a16da4        waisbrot/wait:latest              "/wait"                  4 minutes ago       Exited (0) 4 minutes ago                                                                                                                                                                                                                                                                                                                 wait-for-janus-test
  9dbf0739561f        whoop/downsampler:master          "./run.bash"             4 minutes ago       Up 4 minutes                0.0.0.0:32855-&gt;4369/tcp, 0.0.0.0:32854-&gt;9100/tcp, 0.0.0.0:32853-&gt;9101/tcp, 0.0.0.0:32852-&gt;9102/tcp, 0.0.0.0:32851-&gt;9103/tcp, 0.0.0.0:32850-&gt;9104/tcp, 0.0.0.0:32849-&gt;9105/tcp, 0.0.0.0:32848-&gt;9106/tcp, 0.0.0.0:32847-&gt;9107/tcp, 0.0.0.0:32846-&gt;9108/tcp, 0.0.0.0:32845-&gt;9109/tcp, 0.0.0.0:32844-&gt;9110/tcp   metrics-downsampler-test
  6cf56623bb48        whoop/janus:master                "./start.bash"           4 minutes ago       Up 4 minutes                0.0.0.0:32843-&gt;80/tcp                                                                                                                                                                                                                                                                                        janus-test
  882b50303d54        whoop/recalculator:master         "./run.bash"             4 minutes ago       Exited (1) 4 minutes ago                                                                                                                                                                                                                                                                                                                 internum-test
  </code></pre>
  
  <p>It can be instructed to output only specific columns:</p>
  
  <pre><code>docker ps --format "table {{.Image}}\t{{.Names}}\t{{.Ports}}\t{{.Status}}"
  </code></pre>
  
  <p>I'd like to be able to say <code>docker ps</code> and get the <code>--format "table..."</code> argument added on for me. Is there a nice way to do this? </p>
  
  <p>I know I could say</p>
  
  <pre><code>alias dp='docker ps --format ...'
  </code></pre>
  
  <p>but I'd prefer to keep the sub-command. </p>
  
  <p>I'm using zsh as my shell.</p>