Factor out command line extraction logic
Factor out command line extraction logic

Summary:
This logic will be reused for a new flag that would allow
clients to pass files using a `-f` or `--flagfile` command line flag,
which will eventually replace `flagfile` notation.

Test Plan: CI

Reviewed By: bertmaher

fbshipit-source-id: 9f1fe7b

clonetwin26/buck,kageiit/buck,ilya-klyuchnikov/buck,shs96c/buck,LegNeato/buck,Addepar/buck,SeleniumHQ/buck,LegNeato/buck,brettwooldridge/buck,facebook/buck,ilya-klyuchnikov/buck,SeleniumHQ/buck,rmaz/buck,Addepar/buck,rmaz/buck,shybovycha/buck,SeleniumHQ/buck,Addepar/buck,nguyentruongtho/buck,romanoid/buck,brettwooldridge/buck,JoelMarcey/buck,ilya-klyuchnikov/buck,rmaz/buck,clonetwin26/buck,clonetwin26/buck,shybovycha/buck,brettwooldridge/buck,JoelMarcey/buck,clonetwin26/buck,brettwooldridge/buck,facebook/buck,JoelMarcey/buck,JoelMarcey/buck,shs96c/buck,shs96c/buck,Addepar/buck,JoelMarcey/buck,zpao/buck,Addepar/buck,rmaz/buck,zpao/buck,romanoid/buck,shybovycha/buck,brettwooldridge/buck,shybovycha/buck,shybovycha/buck,ilya-klyuchnikov/buck,Addepar/buck,shs96c/buck,shs96c/buck,Addepar/buck,LegNeato/buck,kageiit/buck,romanoid/buck,kageiit/buck,zpao/buck,romanoid/buck,JoelMarcey/buck,kageiit/buck,rmaz/buck,shybovycha/buck,romanoid/buck,SeleniumHQ/buck,facebook/buck,SeleniumHQ/buck,clonetwin26/buck,nguyentruongtho/buck,JoelMarcey/buck,ilya-klyuchnikov/buck,LegNeato/buck,ilya-klyuchnikov/buck,romanoid/buck,zpao/buck,ilya-klyuchnikov/buck,LegNeato/buck,Addepar/buck,romanoid/buck,zpao/buck,nguyentruongtho/buck,JoelMarcey/buck,SeleniumHQ/buck,JoelMarcey/buck,ilya-klyuchnikov/buck,romanoid/buck,clonetwin26/buck,shybovycha/buck,Addepar/buck,LegNeato/buck,Addepar/buck,SeleniumHQ/buck,clonetwin26/buck,JoelMarcey/buck,shs96c/buck,brettwooldridge/buck,SeleniumHQ/buck,brettwooldridge/buck,Addepar/buck,brettwooldridge/buck,shybovycha/buck,romanoid/buck,nguyentruongtho/buck,LegNeato/buck,facebook/buck,JoelMarcey/buck,SeleniumHQ/buck,clonetwin26/buck,LegNeato/buck,JoelMarcey/buck,ilya-klyuchnikov/buck,brettwooldridge/buck,shs96c/buck,Addepar/buck,rmaz/buck,nguyentruongtho/buck,rmaz/buck,rmaz/buck,romanoid/buck,zpao/buck,shybovycha/buck,LegNeato/buck,brettwooldridge/buck,clonetwin26/buck,nguyentruongtho/buck,shybovycha/buck,nguyentruongtho/buck,Addepar/buck,romanoid/buck,shs96c/buck,LegNeato/buck,clonetwin26/buck,rmaz/buck,rmaz/buck,romanoid/buck,rmaz/buck,JoelMarcey/buck,ilya-klyuchnikov/buck,rmaz/buck,SeleniumHQ/buck,shybovycha/buck,facebook/buck,ilya-klyuchnikov/buck,SeleniumHQ/buck,ilya-klyuchnikov/buck,LegNeato/buck,shs96c/buck,rmaz/buck,clonetwin26/buck,ilya-klyuchnikov/buck,LegNeato/buck,shybovycha/buck,kageiit/buck,clonetwin26/buck,brettwooldridge/buck,facebook/buck,romanoid/buck,shs96c/buck,kageiit/buck,shs96c/buck,kageiit/buck,shybovycha/buck,brettwooldridge/buck,LegNeato/buck,SeleniumHQ/buck,shs96c/buck,shs96c/buck,SeleniumHQ/buck,clonetwin26/buck,facebook/buck,brettwooldridge/buck,zpao/buck