-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3590c2d
commit 7791743
Showing
50 changed files
with
439 additions
and
371 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
package main | ||
|
||
import ( | ||
"flag" | ||
"fmt" | ||
|
||
"github.com/sirupsen/logrus" | ||
|
||
"github.com/salt-today/salttoday2/pkg/scraper" | ||
"github.com/salt-today/salttoday2/pkg/server" | ||
) | ||
|
||
func main() { | ||
flag.Usage = func() { | ||
fmt.Println("\nSalttoday scrapes comments from various news sites and displays them.") | ||
fmt.Println("\nUsage:") | ||
fmt.Println("\n\tsalttoday <command> [arguments]") | ||
fmt.Println("\nCommands:") | ||
fmt.Println(` server Runs the HTTP server`) | ||
fmt.Println(` scraper Runs the scraper to collect and store comments`) | ||
fmt.Println() | ||
} | ||
flag.Parse() | ||
|
||
switch flag.Arg(0) { | ||
case `server`: | ||
server.Main() | ||
case `scraper`: | ||
scraper.Main() | ||
default: | ||
if len(flag.Arg(0)) == 0 { | ||
logrus.Error(`command not provided`) | ||
} else { | ||
logrus.Errorf(`%q is not a valid command.`, flag.Arg(0)) | ||
} | ||
flag.Usage() | ||
} | ||
} |
Oops, something went wrong.