[PR #654] [MERGED] Involve foreground mode switch for up cmd #12830

Closed
opened 2026-08-05 02:06:47 -04:00 by saavagebueno · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/netbirdio/netbird/pull/654
Author: @pappz
Created: 1/15/2023
Status: Merged
Merged: 1/16/2023
Merged by: @mlsmaycon

Base: mainHead: main


📝 Commits (3)

  • 733221b Involve daemon mode switch for up cmd
  • 4fde91a Remove else and return
  • 8677b80 Rename daemon cmd line flag to foreground

📊 Changes

1 file changed (+115 additions, -99 deletions)

View changed files

📝 client/cmd/up.go (+115 -99)

📄 Description

Add new --foreground-mode command line parameter
for 'up' cmd instead of existing log-file workaround

Describe your changes

During debug the service, I am interested in output of the service. With this option it is easily configurable.
I tried to follow the current code style pattern, nevertheless I recommend to organize the content of the up.go into a new struct and register the upCmd into the cobra via a new function like this func registerUpCmd(rootCmd *cobra.Command). With it you can avoid global variables and init() functions.

Checklist

  • Is it a bug fix
  • Is a typo/documentation fix
  • Is a feature enhancement
  • Created tests that fail without the change (if possible)
  • Extended the README / documentation, if necessary

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/netbirdio/netbird/pull/654 **Author:** [@pappz](https://github.com/pappz) **Created:** 1/15/2023 **Status:** ✅ Merged **Merged:** 1/16/2023 **Merged by:** [@mlsmaycon](https://github.com/mlsmaycon) **Base:** `main` ← **Head:** `main` --- ### 📝 Commits (3) - [`733221b`](https://github.com/netbirdio/netbird/commit/733221b2631a0e35bde4d35ec4cd15fad80fec56) Involve daemon mode switch for up cmd - [`4fde91a`](https://github.com/netbirdio/netbird/commit/4fde91aebac838a0c9d7bd12bd10a043b5bdb016) Remove else and return - [`8677b80`](https://github.com/netbirdio/netbird/commit/8677b80eec4dd93378bc831d126549b6781a5009) Rename daemon cmd line flag to foreground ### 📊 Changes **1 file changed** (+115 additions, -99 deletions) <details> <summary>View changed files</summary> 📝 `client/cmd/up.go` (+115 -99) </details> ### 📄 Description Add new --foreground-mode command line parameter for 'up' cmd instead of existing log-file workaround ## Describe your changes During debug the service, I am interested in output of the service. With this option it is easily configurable. I tried to follow the current code style pattern, nevertheless I recommend to organize the content of the up.go into a new struct and register the upCmd into the cobra via a new function like this ```func registerUpCmd(rootCmd *cobra.Command)```. With it you can avoid global variables and ```init()``` functions. ## Issue ticket number and link ### Checklist - [ ] Is it a bug fix - [ ] Is a typo/documentation fix - [x] Is a feature enhancement - [ ] Created tests that fail without the change (if possible) - [ ] Extended the README / documentation, if necessary --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
saavagebueno added the pull-request label 2026-08-05 02:06:47 -04:00
Sign in to join this conversation.
No Label pull-request
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: DYNR/netbird#12830