Skip to content

Commit

Permalink
Merge pull request #297 from fschaefer/master
Browse files Browse the repository at this point in the history
Add a command line argument for the currency symbol for cost estimation
  • Loading branch information
boyter committed Oct 28, 2021
2 parents b458dee + 00633b1 commit 57056b4
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
6 changes: 6 additions & 0 deletions main.go
Expand Up @@ -294,6 +294,12 @@ func main() {
"",
"inspect every file and remap by checking for a string and remapping the language [e.g. \"-*- C++ -*-\":\"C Header\"]",
)
flags.StringVar(
&processor.CurrencySymbol,
"currency-symbol",
"$",
"set currency symbol",
)

if err := rootCmd.Execute(); err != nil {
os.Exit(1)
Expand Down
2 changes: 1 addition & 1 deletion processor/formatters.go
Expand Up @@ -998,7 +998,7 @@ func calculateCocomo(sumCode int64, str *strings.Builder) {

p := gmessage.NewPrinter(glang.English)

str.WriteString(p.Sprintf("Estimated Cost to Develop (%s) $%d\n", CocomoProjectType, int64(estimatedCost)))
str.WriteString(p.Sprintf("Estimated Cost to Develop (%s) %s%d\n", CocomoProjectType, CurrencySymbol, int64(estimatedCost)))
str.WriteString(fmt.Sprintf("Estimated Schedule Effort (%s) %f months\n", CocomoProjectType, estimatedScheduleMonths))
if math.IsNaN(estimatedPeopleRequired) {
str.WriteString(fmt.Sprintf("Estimated People Required 1 Grandparent\n"))
Expand Down
3 changes: 3 additions & 0 deletions processor/processor.go
Expand Up @@ -118,6 +118,9 @@ var RemapUnknown = ""
// RemapAll allows remapping of all files with a string to search the content for
var RemapAll = ""

// CurrencySymbol allows setting the currency symbol for cocomo project cost estimation
var CurrencySymbol = ""

// FileOutput sets the file that output should be written to
var FileOutput = ""

Expand Down

0 comments on commit 57056b4

Please sign in to comment.