Skip to content

Commit

Permalink
update: operative framework reborn
Browse files Browse the repository at this point in the history
  • Loading branch information
graniet committed Apr 28, 2019
1 parent caf6e47 commit 05bf01e
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 8 deletions.
25 changes: 17 additions & 8 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ import (
"fmt"
"github.com/akamensky/argparse"
"github.com/chzyer/readline"
"github.com/fatih/color"
"github.com/graniet/operative-framework/api"
"github.com/graniet/operative-framework/engine"
"github.com/graniet/operative-framework/session"
"github.com/joho/godotenv"
"github.com/fatih/color"
"io"
"os"
"strings"
Expand Down Expand Up @@ -51,6 +51,11 @@ func main(){
Help: "Run script before prompt starting",
})

quiet := parser.Flag("q", "quiet", &argparse.Options{
Required: false,
Help: "Don't prompt operative shell",
})

err = parser.Parse(os.Args)
if err != nil{
fmt.Print(parser.Usage(err))
Expand Down Expand Up @@ -82,13 +87,6 @@ func main(){
}
}

if *verbose{
sess.Stream.Verbose = false
} else{
c := color.New(color.FgYellow)
_, _ = c.Println("OPERATIVE FRAMEWORK - DIGITAL INVESTIGATION FRAMEWORK")
}

if *scripts != ""{
file, err := os.Open(*scripts)
defer file.Close()
Expand All @@ -107,6 +105,17 @@ func main(){
}
}

if *quiet{
return
}

if *verbose{
sess.Stream.Verbose = false
} else{
c := color.New(color.FgYellow)
_, _ = c.Println("OPERATIVE FRAMEWORK - DIGITAL INVESTIGATION FRAMEWORK")
}


l, err := readline.NewEx(sess.Prompt)
if err != nil {
Expand Down
8 changes: 8 additions & 0 deletions scripts/exemple.opf
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
// Disallow event text
session_stream set VERBOSE false
session_stream run

// Add target to session
target add twitter graniet75

// Running API
api run

// Allow event text
session_stream set VERBOSE true
session_stream run

0 comments on commit 05bf01e

Please sign in to comment.